import request from '@/utils/request'

const api_name = '/order'
// 获取列表
export default {
  showsell(data) {
    return request({
      url: `${api_name}/showsell`,
      method: 'get',
      params: data
    })
  },
  showName() {
    return request({
      url: `${api_name}/showname`,
      method: 'get'
    })
  },
  showpurchase(data) {
    return request({
      url: `${api_name}/showprocure`,
      method: 'post',
      data: data
    })
  },
  showStockProducts(data) {
    return request({
      url: `stock/productsShow`,
      method: 'post',
      data: data
    })
  },
  updateSell(data) {
    return request({
      url: `${api_name}/updateSell`,
      method: 'post',
      data: data
    })
  },
  addOrder(data) {
    return request({
      url: `${api_name}/addsell`,
      method: 'put',
      data: data
    })
  },
  addPurchase(orderInfo) {
    return request({
      url: `${api_name}/purchase`,
      method: 'put',
      data: orderInfo
    })
  },
  financialyear() {
    return request({
      url: `${api_name}/financialyear`,
      method: 'get'
    })
  },
  financial(year) {
    return request({
      url:`${api_name}/financial/${year}`,
      method: 'get'
    })
  },
  homeorder(order) {
    return request({
      url:`${api_name}/${order}`,
      method: 'get'
    })
  },
  getAllPrice() {
    return request({
      url: `${api_name}/getAllPrice`,
      method: 'get'
    })
  },
  getAllOrderCount() {
    return request({
      url: `${api_name}/getAllOrderCount`,
      method: 'get'
    })
  },
  getAllByYearAndMonth(year) {
    return request({
      url: `${api_name}/getAllByYearAndMonth/${year}`,
      method: 'get'
    })
  }
}
